﻿





using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tunynet.Repositories;
using Tunynet;
using Tunynet.Common;
using Tunynet.Caching;

namespace Spacebuilder.Group
{
    /// <summary>
    /// 商户成员仓储接口
    /// </summary>
    public interface IGroupMemberRepository : IRepository<GroupMember>
    {
        /// <summary>
        /// 获取单个商户成员
        /// </summary>
        /// <param name="groupId">商户ID</param>
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        GroupMember GetMember(long groupId, long userId);

        /// <summary>
        /// 获取商户所有成员用户Id集合(用于推送动态）
        /// </summary>
        /// <param name="groupId">商户Id</param>
        /// <returns></returns>
        IEnumerable<long> GetUserIdsOfGroup(long groupId);

        /// <summary>
        /// 获取商户管理员
        /// </summary>
        /// <param name="groupId">商户Id</param>
        /// <returns>若没有找到，则返回空集合</returns>
        IEnumerable<long> GetGroupManagers(long groupId);

        /// <summary>
        /// 获取商户成员
        /// </summary>
        /// <param name="groupId">商户Id</param>
        /// <param name="hasManager">是否包含管理员</param>
        /// <param name="sortBy">排序字段</param>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="pageIndex">页码</param>       
        /// <returns>商户成员分页数据</returns>
        PagingDataSet<GroupMember> GetGroupMembers(long groupId, bool hasManager, SortBy_GroupMember sortBy, int pageSize, int pageIndex);


        /// <summary>
        /// 获取我收藏的用户中同时加入某个商户的商户成员
        /// </summary>
        /// <param name="groupId">商户Id</param>
        /// <param name="userId">当前用户的userId</param>
        /// <returns></returns>
        IEnumerable<GroupMember> GetGroupMembersAlsoIsMyFollowedUser(long groupId, long userId);
        /// <summary>
        /// 在线商户成员
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        IEnumerable<GroupMember> GetOnlineGroupMembers(long groupId);

        /// <summary>
        /// 获取商户下的所有成员
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        IEnumerable<GroupMember> GetAllMembersOfGroup(long groupId);
    }
}